package com.zhuss.juc;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;


public class Test03 {
	
	static int i = 10;
	
	public static void main(String[] args) throws InterruptedException {
		CountDownLatch latch = new CountDownLatch(i);
		
		for (int j = 0; j < i; j++) {
			new Thread(()-> {
				for (int k = 0; k < 10; k++) {
					try {
						Thread.sleep(1000);
					} catch (Exception e) {
						e.printStackTrace();
					}
					System.out.println("111"); 
				}
				latch.countDown();
			}).start();
		}
		
		latch.await();
		System.out.println("latch 结束");
	}

}

